package cn.appsys.service.developer;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.appsys.dao.datadictionary.DataDictionaryMapper;
import cn.appsys.pojo.DataDictionary;

@Service
public class DataDictionaryServiceImpl implements DataDictionaryService {
	
	@Resource
	private DataDictionaryMapper dataDictionaryMapper;
	
	@Override
	public List<DataDictionary> getDataDictionaryList(String typeCode)
			throws Exception {
		// TODO Auto-generated method stub
		return dataDictionaryMapper.getDataDictionaryList(typeCode);
	}

	@Override
	public List<DataDictionary> queryDataDictionary(Map<String,Object> map) {
		return dataDictionaryMapper.selectDataDictionaryForPageByTypeNameAndValueName(map);
	}

	@Override
	public int queryDataDictionaryCount(Map<String,Object> map) {
		return dataDictionaryMapper.selectDataDictionaryCount(map);
	}

	@Override
	public List<DataDictionary> queryDataDictionaryTypeNameForDistinct() {
		return dataDictionaryMapper.selectDataDictionaryTypeNameForDistinct();
	}

	@Override
	public List<DataDictionary> queryDataDictionaryByTypeName(String typeName) {
		return dataDictionaryMapper.selectDataDictionaryByTypeName(typeName);
	}

	@Override
	public int saveCreateDataDictionary(DataDictionary dataDictionary) {
		return dataDictionaryMapper.insertDataDictionary(dataDictionary);
	}

	@Override
	public int deleteDataDictionaryById(int id) {
		return dataDictionaryMapper.deleteDataDictionaryById(id);
	}

	@Override
	public int editDataDictionarById(DataDictionary dataDictionary) {
		return dataDictionaryMapper.updateDataDictionaryById(dataDictionary);
	}

	@Override
	public DataDictionary queryDataDictionaryById(int id) {
		return dataDictionaryMapper.selectDataDictionaryById(id);
	}

}
